package com.wt.admin.domain.entity.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.wt.admin.domain.entity.PublicEntity;
import lombok.Data;

@Data
@TableName(value = "sys_operation_log",autoResultMap = true)
public class SysOperationLogEntity extends PublicEntity implements Cloneable {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @TableField(value = "log_name")
    private String logName;

    @TableField(value = "user_id")
    private Integer userId;

    @TableField(value = "log_method")
    private String logMethod;

    @TableField(value = "log_path")
    private String logPath;

    @TableField(value = "log_param",typeHandler = JacksonTypeHandler.class)
    private Object logParam;

    @TableField(value = "log_result_code")
    private Integer logResultCode;

    @TableField(value = "log_time")
    private Integer logTime;

    @TableField(exist = false)
    private String nickName;

    @Override
    public SysOperationLogEntity clone() {
        try {
            return (SysOperationLogEntity) super.clone();
        }catch (Exception e){
            return new SysOperationLogEntity();
        }
    }
}
